32.2 The Scripts

32.2.1 Create your R Script with all Functions

The functions script contains all the routines and functions that are being applied in your plugin. Create an R Script file in the folder ”scripts” and start with the following section to install the insensa package and devtools package (but only if not installed already).

 
if(!requireNamespace(”insensa”)) { 
  if(!requireNamespace(”devtools”)) { 
    install.packages(”devtools”) 
  } 
  devtools::install_bitbucket(”dbiber/rinsensa”) 
  loadNamespace(”insensa”) 
}

We wont explain here how to program scripts R but we will give you an overview of the functions implemented in the Insensa package and how to use them.

Some general useful functions are:

The following functions allow you to access values either set or calculated by Insensa GIS and use them in your R Script:

Help and details how to use each function can be accessed, as usual, through R with using ?getVar or help(getVar).

32.2.2 Create your R Script for the UI

The settings script is optional and defines the settings dialog within the Insensa GIS user interface. The following functions allow you to create a standardized dialogue but with a relatively high flexibility: